<?php
require_once('../src/Words2img.php');

$words = array(
	'那年，也是在这样的一个雨季，我拖着极简的行装，怀着忐忑不宁的心情又回到曾经谋生的地方，看着即将成为一家的同事进进出出，神色匆忙，脸上写满憔悴与无奈，原来的熟知，也只是笑笑而已，似有很重要的事情要做，来不及拉拉话儿，就闪身离去，先前的那种闲适的优越感瞬间滑落。',

	array('img.jpg', '100%', 'auto'),

	'「あんまり、やりたくないなあ」そう思いながらもやらなければいけないことが、世の中には、けっこうある。だけど、いやでも、本心じゃなくても、やってるのは自分。そして、それを選んでいるのも実は自分自身。',

	array('img.jpg', '80%', 'auto', 'center'),

	array('img.jpg', 350, 250, 'center'),
);

$wordstype = 'cn';                //语言类型[cn汉字系, en拉丁语系]
$size = 12;                       //字体大小
$wordswidth = 16.4;               //每个文字宽度
$width = 600;                     //画布宽度
$height = 'auto';                 //画布高度
$padding = 20;                    //边距
$lineheight = 35;                 //行高
$color = array(255, 255, 255);    //文字颜色
$bgcolor = array(230, 127, 127);  //背景颜色

$Wimg = new Words2img($words, $wordstype, $size, $wordswidth, $width, $height, $padding, $lineheight, $color, $bgcolor);
$Wimg->savedir('data/');  //保存目录
$a = $Wimg->img();
print_r('<img src="'.$a.'" />');

echo '<br /><br />';

/****************************************/

$words = array(
	'There are many apple trees in a garden. They\'re good friends. One day an old tree is ill. There are many pests in the tree. Leaves of the tree turn yellow. The old tree feels very sad and unwell. Another tree sends for a doctor for him. At first, they send for a pigeon, but she has no idea about it. Then they send for an oriole, and she can\'t treat the old tree well. Then they send for a woodpecker. She is a good doctor. She pecks a hole in the tree and eats lots of pests. At last the old tree becomes better and better. Leaves turn green and green.',

	' ',

	'Today is Sunday! On Sundays, I usually play the flute.My father usually reads the newspaper. My motherusuallycleansthe house. Buttoday my mother is in bed. She is ill. My father has to do the housework. Now, he is cleaning the house. "Sam, can you help me?" "Yes, Dad!" Now, we\'re washing the car. Where\'s my sister, Amy? She is playing my flute. What a lucky girl!'
);

$wordstype = 'en';                    //语言类型[cn汉字系, en拉丁语系]
$size = 12;                           //字体大小
$wordswidth = 10;                     //每个文字宽度
$width = 600;                         //画布宽度
$height = 'auto';                     //画布高度
$padding = 20;                        //边距
$lineheight = 30;                     //行高
$color = array(255, 255, 255);        //文字颜色
$bgcolor = array(230, 127, 127);      //背景颜色

$Wimg = new Words2img($words, $wordstype, $size, $wordswidth, $width, $height, $padding, $lineheight, $color, $bgcolor);
$Wimg->savedir('data2/');  //保存目录
$b = $Wimg->img();
print_r('<img src="'.$b.'" /><br />');